var express = require('express');
var router = express.Router();

var mysql = require('mysql')
	var conn = mysql.createConnection({
			host:'localhost',
			user:'root',
			password:'123456',
			database: 'projects',
			port: 3306
		});
	conn.connect();

router.get('/', function(req, res, next) {
	conn.query("select * from articles",function(err,rows,fields){
					if (err) throw err;
  res.render('index', { title: 'Express' });
});

module.exports = router;
